<!DOCTYPE html>
<html>
<head>
	<title></title>
	<!--[if lt IE 9]>
	<meta http-equiv="refresh" content="0;ie.html" />
	<![endif]-->

	<link rel="shortcut icon" href="__STATIC__/layout/favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
	<link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
	 <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
	<script src="__STATIC__/layout/js/jquery.min.js"></script>
	<!-- Sweet Alert -->
	<link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<!-- Sweet alert -->
	<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
	<!-- layer javascript -->
	<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>

	<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
	<style>
		.renyuan{
			position:absolute;left:0;top:36px;
			z-index:3;
		}
		.renyuan span.ren{
			display: inline-block;
			background:#d0e0e0;border:1px solid #ccc;border-radius:5px;font-size:14px;
		}
		.renyuan span.close{
			    font-size: 18px;
    			margin-left: 4px;
			color:black!important;
		}
	</style>
</head>
<body class="gray-bg">

<div class="ibox">
			<div class="ibox-content">
				<form role="form" id="formadd" method="post" action="{:url('setprovice')}">
					<input type="hidden" name="cities" id="cities" value="{$cities}">
					<div class="row form-group" style="margin-bottom: 25px;">
						<label class="col-xs-3 control-label">分区名称</label>
						<div class="col-xs-9">
							<select name="zoning" id="zoning" class="select form-control">
								<option value="">请选择</option>
								{volist name="fenqu" id="row"}
								<option value="{$row.id}">{$row.title}</option>
								{/volist}
							</select>
						</div>
					</div>
					<div class="row form-group" style="margin-bottom: 25px;">
						<label class="col-xs-3 control-label">所属省份</label>
						<div class="col-xs-9">
							<select name="provice" id="provice" class="form-control">

							</select>
						</div>
					</div>
					<script>
                        $(function () {
                            $('#zoning').on('change',function () {
                                var id = $(this).val()
                                $('#provice').load('{:url("getprovices")}?id='+id)
                            })
                        })
					</script>
					<div class="row">
						<div class="col-xs-12 text-center">
							<input class="btn btn-sm btn-primary m-t-n-xs" type="submit" id="tijiao" value="提 交">
							<input class="btn btn-sm btn-white m-t-n-xs" type="button" id="fanhui" value="返 回">

						</div>
					</div>
			</form>
		</div>

</div>

</body>
</html>
<script>
    $(function () {
		//提交
        $('body').on('click','#tijiao',function () {
            var form =  $('#formadd')
            var cities =  $('#cities').val()
            var provice =  $('#provice').val()
            $.ajax({
                'type':'post',
                'url':form.attr('action'),
                'data':{cities:cities,provice:provice},
                'dataType':'json',
                'success':function (data) {
                    if(data.success){
                        swal({
                            title: data.msg,
                            type: "success"
                        },function(){
                            parent.location.reload()
						});

                    }else
                        swal({
                            title: data.msg,
                            type: "warning"
                        });
                }
            })
			return false
        })
		$('#fanhui').on('click',function () {
			parent.layer.close(parent.layer.getFrameIndex(window.name))
        })
    })
</script>